﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Mammoth.Entities;
using Mammoth.Events;
using Mammoth.Services;
using Mammoth.Validations;
using Mammoth.ViewModels;

namespace Mammoth.Views.Account
{
    /// <summary>
    /// Interaction logic for AddAccountForm.xaml
    /// </summary>
    public partial class AddAccountForm : UserControl
    {
        AddAccountFormViewModel viewModel = null;

        public AddAccountForm(IViewModelFactory vmFactory) : this(vmFactory, null) { }
        public AddAccountForm(IViewModelFactory vmFactory, object arguments)
        {
            InitializeComponent();
            DataContext = viewModel = vmFactory.GetViewModel<AddAccountFormViewModel>(this, arguments);
            PasswordText.Password = viewModel.Password;
        }

        private void Save_Click(object sender, RoutedEventArgs e)
        {
            viewModel.Password = PasswordText.Password;
            viewModel.Save();
        }
    }
}
